<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MDF Lib: include/mdf/zlibutil.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="utillib.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">MDF Lib<span id="projectnumber">&#160;2.2</span>
   </div>
   <div id="projectbrief">Interface against MDF 3/4 files</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_dea88a92c3ac1d8c329848683c200b71.html">mdf</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">zlibutil.h</div></div>
</div><!--header-->
<div class="contents">
<a href="zlibutil_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * Copyright 2022 Ingemar Hedvall</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> * SPDX-License-Identifier: MIT</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> */</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &lt;cstdio&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemdf.html">mdf</a> {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="namespacemdf.html#a3b0b6ca099e0f57ab319de3223cc008c">   17</a></span><span class="keyword">using </span><a class="code hl_typedef" href="namespacemdf.html#a3b0b6ca099e0f57ab319de3223cc008c">ByteArray</a> = std::vector&lt;uint8_t&gt;;  </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="namespacemdf.html#aad071f40993f8c69d4faf24378fdc731">   26</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemdf.html#aad071f40993f8c69d4faf24378fdc731">Deflate</a>(std::FILE* in, std::FILE* out);  </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="namespacemdf.html#aadc429ba87b1a6757c12e4d8bf3c3583">   41</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemdf.html#aad071f40993f8c69d4faf24378fdc731">Deflate</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="namespacemdf.html#a3b0b6ca099e0f57ab319de3223cc008c">ByteArray</a>&amp; buf_in,</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>             <a class="code hl_typedef" href="namespacemdf.html#a3b0b6ca099e0f57ab319de3223cc008c">ByteArray</a>&amp; buf_out);  </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="namespacemdf.html#a2204306496d6be8d0755d78c6b2f3f8a">   55</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemdf.html#aad071f40993f8c69d4faf24378fdc731">Deflate</a>(<span class="keyword">const</span> std::string&amp; filename,</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>             <a class="code hl_typedef" href="namespacemdf.html#a3b0b6ca099e0f57ab319de3223cc008c">ByteArray</a>&amp; buf_out);  </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="namespacemdf.html#a0d68d0de49ecec2f114dbfa84445f0e0">   58</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemdf.html#a0d68d0de49ecec2f114dbfa84445f0e0">Inflate</a>(std::FILE* in, std::FILE* out);  </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="namespacemdf.html#a5fb9cd270f5eb188adb9e3da05638f75">   59</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemdf.html#a0d68d0de49ecec2f114dbfa84445f0e0">Inflate</a>(std::FILE* in, std::FILE* out,</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>             uint64_t nof_bytes);  </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="namespacemdf.html#a8ac44ea44a6225ec667cf46eba2f8293">   61</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemdf.html#a0d68d0de49ecec2f114dbfa84445f0e0">Inflate</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="namespacemdf.html#a3b0b6ca099e0f57ab319de3223cc008c">ByteArray</a>&amp; in,</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>             <a class="code hl_typedef" href="namespacemdf.html#a3b0b6ca099e0f57ab319de3223cc008c">ByteArray</a>&amp; out);  </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="namespacemdf.html#aca89e1bde497bbab2f230a4b58e5c857">   63</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemdf.html#a0d68d0de49ecec2f114dbfa84445f0e0">Inflate</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="namespacemdf.html#a3b0b6ca099e0f57ab319de3223cc008c">ByteArray</a>&amp; in,</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span>             std::FILE* out);  </div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span> </div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="namespacemdf.html#a8888854dace05f8886586643a4e566cd">   66</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="namespacemdf.html#a8888854dace05f8886586643a4e566cd">Transpose</a>(<a class="code hl_typedef" href="namespacemdf.html#a3b0b6ca099e0f57ab319de3223cc008c">ByteArray</a>&amp; data,</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span>               <span class="keywordtype">size_t</span> record_size);  </div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="namespacemdf.html#a6dcedb9a891a56428a5390e5cc4b5b57">   68</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="namespacemdf.html#a6dcedb9a891a56428a5390e5cc4b5b57">InvTranspose</a>(<a class="code hl_typedef" href="namespacemdf.html#a3b0b6ca099e0f57ab319de3223cc008c">ByteArray</a>&amp; data,</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>                  <span class="keywordtype">size_t</span> record_size);  </div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>}  <span class="comment">// namespace mdf</span></div>
<div class="ttc" id="anamespacemdf_html"><div class="ttname"><a href="namespacemdf.html">mdf</a></div><div class="ttdoc">Main namespace for the MDF library.</div><div class="ttdef"><b>Definition</b> canmessage.h:17</div></div>
<div class="ttc" id="anamespacemdf_html_a0d68d0de49ecec2f114dbfa84445f0e0"><div class="ttname"><a href="namespacemdf.html#a0d68d0de49ecec2f114dbfa84445f0e0">mdf::Inflate</a></div><div class="ttdeci">bool Inflate(std::FILE *in, std::FILE *out)</div><div class="ttdoc">Decompress file to file.</div></div>
<div class="ttc" id="anamespacemdf_html_a3b0b6ca099e0f57ab319de3223cc008c"><div class="ttname"><a href="namespacemdf.html#a3b0b6ca099e0f57ab319de3223cc008c">mdf::ByteArray</a></div><div class="ttdeci">std::vector&lt; uint8_t &gt; ByteArray</div><div class="ttdoc">Defines a dynamic byte array.</div><div class="ttdef"><b>Definition</b> zlibutil.h:17</div></div>
<div class="ttc" id="anamespacemdf_html_a6dcedb9a891a56428a5390e5cc4b5b57"><div class="ttname"><a href="namespacemdf.html#a6dcedb9a891a56428a5390e5cc4b5b57">mdf::InvTranspose</a></div><div class="ttdeci">void InvTranspose(ByteArray &amp;data, size_t record_size)</div><div class="ttdoc">Invert transpose of an array.</div></div>
<div class="ttc" id="anamespacemdf_html_a8888854dace05f8886586643a4e566cd"><div class="ttname"><a href="namespacemdf.html#a8888854dace05f8886586643a4e566cd">mdf::Transpose</a></div><div class="ttdeci">void Transpose(ByteArray &amp;data, size_t record_size)</div><div class="ttdoc">Transpose of an array.</div></div>
<div class="ttc" id="anamespacemdf_html_aad071f40993f8c69d4faf24378fdc731"><div class="ttname"><a href="namespacemdf.html#aad071f40993f8c69d4faf24378fdc731">mdf::Deflate</a></div><div class="ttdeci">bool Deflate(std::FILE *in, std::FILE *out)</div><div class="ttdoc">Compress file to file.</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
